#!/bin/bash

gradle clean & gradle build -x test

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

# gateway
#cd ./spring-cloud-gateway
#docker build -t harbor.jkservice.org/demo/spring-cloud-gateway:v1 .
#cd ..

# admin
#cd ./spring-cloud-admin
#docker build -t harbor.jkservice.org/demo/spring-cloud-admin:v1 .
#cd ..

# credit
#cd ./spring-cloud-credit
#docker build -t harbor.jkservice.org/demo/spring-cloud-credit:v1 .
#cd ..

# grpc
cd ./spring-cloud-grpc/grpc-server
docker build -t harbor.jkservice.org/demo/grpc-server:latest .
cd ../..

cd ./spring-cloud-grpc/grpc-stub
docker build -t harbor.jkservice.org/demo/grpc-stub:latest .
cd ../..


docker images
# docker push harbor.jkservice.org/demo/spring-cloud-gateway:v1
# docker push harbor.jkservice.org/demo/spring-cloud-admin:v1
# docker push harbor.jkservice.org/demo/spring-cloud-credit:v1
docker push harbor.jkservice.org/demo/grpc-server:latest
docker push harbor.jkservice.org/demo/grpc-stub:latest
